<template>
   <table border="1px" cellspacing="0" cellpadding="0" class="table" style="background-color:#FFFFFF;">
        <tr><td align="center" colspan="10">个人基本信息</td></tr>
        <tr>
            <td>身份</td>
            <td colspan="3">
            <el-cascader
            style="width:100%;"
              v-model="form.level"
              :options="options"
              :props="{ expandTrigger: 'hover' }" disabled></el-cascader>
             </td>
           <!-- <td colspan="2">是否为心理健康专职辅导员</td>
            <td><input type="text" v-model="form.health"> </td> 
            <td colspan="2">是否为学工管理干部</td>
             <td><input type="text" v-model="form.teacher"> </td>  -->
                <td>是否为班主任</td>
             <td><input type="text" v-model="form.master"></td>
                <!-- <td>辅导员专兼职情况</td>
             <td><input type="text" v-model="form.instructor"> </td> -->
        </tr>
        <tr>
          <td>姓名</td>
          <td><input type="text" v-model="form.name"> </td>
          <td>性别</td>
          <td width="15%"><input type="text" v-model="form.sex"></td>
          <td >出生日期</td>
          <td width="15%"><input type="text" v-model="form.birth"></td>
          <td >民族</td>
          <td><input type="text" v-model="form.nation"></td>
          <td >政治面貌</td>
          <td><input type="text" v-model="form.politics"></td>
        </tr>
        <tr>
          <td >身份证号</td>
          <td><input type="text" v-model="form.idnumber"></td>
          <td>工作单位</td>
          <td colspan="2"><input type="text" v-model="form.sch"></td>
          <td >行政职务</td>
          <td colspan="2"><input type="text" v-model="form.preoccupation"></td>
          <td >专业技术职务</td>
          <td><input type="text" v-model="form.majoroccupation"></td>
        </tr>
        <tr>
          <td>参加工作时间</td>
          <td><input type="text" v-model="form.majortime"></td>
          <td >职务级别</td>
          <td colspan="2"><input type="text" v-model="form.jobrank"></td>
          <td>最高学历</td>
          <td colspan="2"><input type="text" v-model="form.edu"></td>
          <td >最后学位</td>
          <td><input type="text" v-model="form.degree">  </td>
        </tr>
        <tr>
          <td >邮政编码</td>
          <td><input type="text" v-model="form.postalcode"></td>
          <td >办公电话</td>
          <td><input type="text" v-model="form.office"></td>
          <td >手机</td>
          <td><input type="text" v-model="form.phone"></td>
          <td>qq号</td>
          <td colspan="1.5"><input type="text" v-model="form.qq"></td>
          <td  colspan="1.5">电子信箱</td>
          <td><input type="text" v-model="form.email"></td>
        </tr>
        <tr>
            <td>传真</td>
            <td><input type="text" v-model="form.fax"></td>
          <td>通讯地址</td>
          <td colspan="3"><input type="text" v-model="form.address"></td>
          <td>所带学生层次</td>
            <td><input type="text" v-model="form.student_degree"></td>
          <td>所带学生人数</td>
          <td colspan="3"><input type="text" v-model="form.student_number"></td>
        </tr>
        <tr><td colspan="10">工作经历</td></tr> 
        <tr><td colspan="10">
            <el-table
            :data="exwork_tableData"
            border
            style="width: 100%;">
            <el-table-column
            prop="work"
            label="工作单位">
            </el-table-column>
            <el-table-column
            prop="preoccupation"
            label="职务">
            </el-table-column>
            <el-table-column
            prop="start_time"
            label="开始时间">
            </el-table-column>
            <el-table-column
            prop="end_time"
            label="结束时间">
            </el-table-column>
        </el-table>
        </td>
        </tr>
        <div id="exwork"></div>
        <tr><td colspan="10">教育经历</td></tr>
        <tr>
            <td colspan="10">
            <el-table
            :data="exedu_tableData"
            border
            style="width: 100%;">
            <el-table-column
            prop="edu_type"
            label="学历类型">
            </el-table-column>
            <el-table-column
            prop="graduated_sch"
            label="毕业院校">
            </el-table-column>
            <el-table-column
            prop="major"
            label="专业">
            </el-table-column>
            <el-table-column
            prop="graduated_time"
            label="毕业时间">
            </el-table-column>
            <el-table-column
            prop="edu_system"
            label="学制">
            </el-table-column>
            <el-table-column
            prop="degree"
            label="学位">
            </el-table-column>
            <el-table-column
            prop="degree_time"
            label="学位授予时间">
            </el-table-column>
            <el-table-column
            prop="degree_sch"
            label="授予学校">
            </el-table-column>
            <el-table-column
            prop="degree_sch_level"
            label="授予学校办学层次">
            </el-table-column>
            <el-table-column
            prop="degree_sch_nature"
            label="授予学校性质">
            </el-table-column>
        </el-table>
        </td>    
        <tr><td colspan="10">培训经历</td></tr>
        <tr>
          <td colspan="10">
            <el-table
            :data="extrain_tableData"
            border
            style="width: 100%;">
            <el-table-column
            prop="traindata_name"
            label="培训名称">
            </el-table-column>
            <el-table-column
            prop="company"
            label="组织单位">
            </el-table-column>
            <el-table-column
            prop="traindata_address"
            label="培训地点">
            </el-table-column>
            <el-table-column
            prop="start_time"
            label="开始时间">
            </el-table-column>
            <el-table-column
            prop="end_time"
            label="结束时间">
            </el-table-column>
            <el-table-column
            prop="traindata_level"
            label="培训级别">
            </el-table-column>
        </el-table>
        </td>  
            <tr><td colspan="10">科研项目</td></tr>
            <tr>
                <td colspan="10">
                    <el-table
                    :data="exproject_tableData"
                    border
                    style="width: 100%;">
                    <el-table-column
                    prop="project_id"
                    label="项目编号">
                    </el-table-column>
                    <el-table-column
                    prop="project_name"
                    label="项目名称">
                    </el-table-column>
                    <el-table-column
                    prop="project_type"
                    label="项目类型">
                    </el-table-column>
                    </el-table>
                </td>
            <tr> <td colspan="10">科研成果 </td></tr>
            <tr>
              <td colspan="10">
                    <el-table
                    :data="exachievement_tableData"
                    border
                    style="width: 100%;">
                    <el-table-column
                    prop="achievement_name"
                    label="成果名称">
                    </el-table-column>
                    <el-table-column
                    prop="publish_company"
                    label="出版单位">
                    </el-table-column>
                    <el-table-column
                    prop="publish_time"
                    label="出版时间">
                    </el-table-column>
                    </el-table>
                </td>
            </tr>
            <tr><td colspan="10">荣誉奖项</td></tr>
            <tr>
               <td colspan="10">
                    <el-table
                    :data="exhonor_tableData"
                    border
                    style="width: 100%;">
                    <el-table-column
                    prop="honor_name"
                    label="获奖名称">
                    </el-table-column>
                    <el-table-column
                    prop="honor_time"
                    label="获奖时间">
                    </el-table-column>
                    <el-table-column
                    prop="honor_company"
                    label="授予单位">
                    </el-table-column>
                    </el-table>
                </td>
            </tr>
      </table>
</template>

<script>
import http from './../../../../assets/js/http.js'
  export default {
    data() {
      return {
          id:'',
          schInfo:Lockr.get('schInfo'),
          form:{
            name:'',
            sex:'',
            nation:'',
            birth:'',
            edu:'',
            degree:'',
            politics:'',
            preoccupation:'',
            majoroccupation:'',
            majortime:'',
            sch:'',
            jobrank:'',
            idnumber:'',
            address:'',
            postalcode:'',
            office:'',
            phone:'',
            email:'',
            fax:'',
            health: '',
            teacher: '',
            master: '',
            instructor: '',
            student_degree: '',
            student_number: '',
            level: [],
            level_1: '',
            level_2: ''
          },
          options: [{
          value: 1,
          label:'本、专科学生工作队伍工作管理',
          children: [{
            value: 1,
            label: '本、专科生专职辅导员'
          },{
            value: 2,
            label: '学工管理干部'
          },{
            value: 3,
            label: '本、专科生兼职辅导员'
          }]
        },{
          value: 2,
          label:'研究生学生工作队伍工作管理',
          children: [{
            value: 1,
            label: '研究生专职辅导员'
          },{
            value: 2,
            label: '研工管理干部'
          },{
            value: 3,
            label: '研究生兼职辅导员'
          }]
        },{
          value: 3,
          label: '心理健康专职教师管理',
          children: [{
            value: 1,
            label: '心理健康专职教师'
          }]
        }],
          exwork_tableData:[],
          exedu_tableData:[],
          extrain_tableData:[],
          exproject_tableData:[],
          exachievement_tableData:[],
          exhonor_tableData:[]

      }
    },
    methods: {
        getData(){
            let data = {
                id :this.id
            }
            this.apiPost('admin/Train/TrainList',data).then((res) =>{
                this.handelResponse(res,(data) =>{
                    console.log(res.data.train[0].level)
                    this.form = res.data.train[0]
                    this.form.health = this.form.health==1?'是':'否' 
                    this.form.level = [this.form.level_1,this.form.level_2]
                    // this.form.teacher = this.form.teacher==1?'是':'否'
                    this.form.master = this.form.master==1?'是':'否'
                    // this.form.instructor = this.form.instructor==1?'专职':'兼职'
                    this.form.sex = this.form.sex==1?'男':'女'
                    switch(this.form.student_degree){
                        case 1: this.form.student_degree = '本科生'; break;
                        case 2: this.form.student_degree = '专科生'; break;
                        case 3: this.form.student_degree = '研究生'; break;
                        default: this.form.student_degree = '无'; break;
                    }
                    this.form.sch = this.schInfo['sch_id_' + this.form.sch]['sch_name']
                    this.exwork_tableData =res.data.exwork
                    this.exedu_tableData = res.data.exedu
                    this.extrain_tableData = res.data.extrain
                    this.exproject_tableData = res.data.exproject
                    this.exachievement_tableData = res.data.exachievement
                    this.exhonor_tableData = res.data.exhonor
                })
            })   
        }
    },
    created() {
      _g.closeGlobalLoading()
      this.id = this.$route.query.item
     this.getData()
    },
    computed: {
    },
    components: {
    },
    mixins: [http]
  }

</script>
<style scoped>
input{
    border: none;
    overflow: hidden;
    height: 100%;
    width: 100%;
    text-align: center;
    background-color:#FFFFFF;
}
</style>

